﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RestSharp;
using Ymatou.ServiceCenter;
using YmatouSeller.Common.API;
using YmatouSeller.NoticeAPI.Model.Response;

namespace YmatouSeller.NoticeAPI.Model.Request
{
     [Resource("sellernotice.iapi.ymatou.com", "api/NoticeManage/DeleteNoticeAttachment", Method.POST, ParameterBuildType.Json)]
    public class DeleteNoticeAttachmentRequest : BaseRequestModel<DeleteNoticeAttachmentResponse>
    {
        public override string ApiName
        {
            get { return "api/NoticeManage/DeleteNoticeAttachment"; }
        }

        public override bool HttpGet
        {
            get { return false; }
        }

        public string NoticeId { get; set; }

        public List<long> NoticeOptionIds { get; set; }

        public override void Validate()
        {
            const string errCode = "-1";
            if (string.IsNullOrEmpty(NoticeId) && (NoticeOptionIds == null || NoticeOptionIds.Count <= 0))
                throw new Ymatou.API.Common.BussniessException(errCode, "附件ID无效");
            base.Validate();
        }
    }
}
